import lejos.nxt.Button;

public class Setup {
  
  public static int readSetting(String name, int start_v, int incr) {
    System.out.println(name + ": " + start_v);
    while(!Button.ENTER.isDown()) {
      if (Button.LEFT.isDown()) {
	start_v -= incr;
	System.out.println(name + ": " + start_v);
      }
      if (Button.RIGHT.isDown()) {
	start_v += incr;
	System.out.println(name + ": " + start_v);
      }
      if (Button.LEFT.isDown() || Button.RIGHT.isDown()) 
	try { Thread.sleep(333); } catch (Exception e) {}
    }
    while(Button.ENTER.isDown()) {}
    return start_v;
  }
  
}